package main

import "fmt"

func printSlice(s []int) {
	fmt.Printf("len=%d, cap=%d %v\n", len(s), cap(s), s)
}

func main() {
	s := []int{1, 2, 3, 4, 5, 6}
	printSlice(s)

	a := make([]int, 5)
	printSlice(a)

	b := make([]int, 1, 5)
	printSlice(b)

	c := b[:2]
	printSlice(c)

	d := c[2:5]
	printSlice(d)

	d = append(d, 1)
	printSlice(d)

	d = append(d, 2, 3, 4)
	printSlice(d)

	for _, v := range d {
		fmt.Println(v)
	}
}
